﻿using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.GameObjects.Containers.Transformable_controls;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.UI
{
    public class OuterBorder : Container
    {

        public override void LoadContent()
        {
            AddChildren(new ImageContainer
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.TopLeftCorner),
            });
            AddChildren(new ImageContainer
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.TopRightCorner),
                PositionGridBound = new TE_Vector2(Game.Options.ScreenSize.X - 2, 0)
            });
            AddChildren(new ImageContainer
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.BottomLeftCorner),
                PositionGridBound = new TE_Vector2(0, Game.Options.ScreenSize.Y - 2)
            });
            AddChildren(new ImageContainer
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.BottomRightCorner),
                PositionGridBound = new TE_Vector2(Game.Options.ScreenSize.X - 2, Game.Options.ScreenSize.Y - 2)
            });

            AddChildren(new RepeatingImage
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.Top),
                PositionGridBound = new TE_Vector2(2, 0),
                Area = new TE_Vector2(Game.Options.ScreenSize.X - 4, 2)
            });
            AddChildren(new RepeatingImage
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.Left),
                PositionGridBound = new TE_Vector2(0, 2),
                Area = new TE_Vector2(2, Game.Options.ScreenSize.Y - 4)
            });
            AddChildren(new RepeatingImage
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.Right),
                PositionGridBound = new TE_Vector2(Game.Options.ScreenSize.X - 2, 2),
                Area = new TE_Vector2(2, Game.Options.ScreenSize.Y - 4)
            });
            AddChildren(new RepeatingImage
            {
                Sprite = BorderSheet.GetSprite(BorderSheet.OuterBorder.Bottom),
                PositionGridBound = new TE_Vector2(2, Game.Options.ScreenSize.Y - 2),
                Area = new TE_Vector2(Game.Options.ScreenSize.X - 4, 2)
            });

            AddChildren(new FpsDrawer { PositionGridBound = new TE_Vector2(0.25f, 0.75f)});

            base.LoadContent();
        }
    }
}